package cn.xianyang.feignclient;


import cn.xianyang.domain.Movie;
import cn.xianyang.utils.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

@FeignClient(value = "movie-server",fallbackFactory = MovieFeignClientFallbackFactory.class) // 指定需要调用的服务的应用名称
public interface MovieFeignClient {
    //需要调用的movie接口 直接CV movie controller
    @GetMapping("/movie")
    AjaxResult findAll();
    @PostMapping("/movie/buyTickets")
    AjaxResult buyTickets(@RequestBody Map map);
    @GetMapping("/movie/{id}")
    Movie findById(@PathVariable("id")Long id);
    @PostMapping("/movie/watch/{id}")
    AjaxResult watch(@PathVariable("id")Long id);
    @GetMapping("/movie/findMaxTicket")
    Movie findMaxTicket();
}